ThrowExceptionCore Method

CuttingEdge.Conditions

Throws an exception.

Namespace:  CuttingEdge.Conditions
Assembly:  CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)

Syntax

Visual Basic (Declaration)
Protected MustOverride Sub ThrowExceptionCore ( _
	condition As String, _
	additionalMessage As String, _
	type As ConstraintViolationType _
)
C#
protected abstract void ThrowExceptionCore(
	string condition,
	string additionalMessage,
	ConstraintViolationType type
)
Visual C++
protected:
virtual void ThrowExceptionCore(
	String^ condition, 
	String^ additionalMessage, 
	ConstraintViolationType type
) abstract
JavaScript
function throwExceptionCore(condition, additionalMessage, type);

Parameters

condition
Type: System..::.String
Describes the condition that doesn't hold, e.g., "Value should not be null".
additionalMessage
Type: System..::.String
An additional message that will be appended to the exception message, e.g. "The actual value is 3.". This value may be null or empty.
type
Type: CuttingEdge.Conditions..::.ConstraintViolationType
Gives extra information on the exception type that must be build. The actual implementation of the validator may ignore some or all values.

Remarks

Implement this method when deriving from ConditionValidator<(Of <(T>)>). The implementation should at least build the exception message from the condition and optional additionalMessage. Usage of the type is completely optional, but the implementation should at least be flexible and be able to handle unknown ConstraintViolationType values. Values may be added in future releases.

Examples

For an example see the documentation for ConditionValidator<(Of <(T>)>).

See Also